<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="../lib/layui/css/layui.css">
  <link rel="stylesheet" href="../styles/css/index.css">
  <script src="../lib/layui/layui.js"></script>
  <style>
    .txt {
      color: red;
    }

    .btn {
      margin-left: 40px;
    }
  </style>
</head>

<body>
  <div class="content">
    <div class="headTitle"><span class="w-blueline"></span>地块添加</div>
    <form class="layui-form" action="">
      <div class="layui-row">
        <div class="layui-row">
          <div class="layui-col-md5">
            <div class="layui-form-item">
              <label class="layui-form-label"><i class="txt">*</i>地块名称</label>
              <div class="layui-input-block">
                <input type="text" name="title" required lay-verify="required" placeholder="请输入地块名称" autocomplete="off"
                  class="layui-input">
              </div>
            </div>
          </div>
          <div class="layui-col-md5">
            <div class="layui-form-item">
              <label class="layui-form-label"><i class="txt">*</i>负责人</label>
              <div class="layui-input-block">
                <input type="text" name="title1" required lay-verify="required" placeholder="请输入负责人" autocomplete="off"
                  class="layui-input">
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-row">
        <div class="layui-row">
          <div class="layui-col-md5">
            <div class="layui-form-item">
              <label class="layui-form-label"><i class="txt">*</i>地块类型</label>
              <div class="layui-input-block">
                <select name="city" lay-verify="required">
                  <option value="0">大棚</option>
                  <option value="1">农场B</option>
                </select>
              </div>
            </div>
          </div>
          <div class="layui-col-md5">
            <div class="layui-form-item">
              <label class="layui-form-label"><i class="txt">*</i>种植标准</label>
              <div class="layui-input-block">
                <select name="city1" lay-verify="required">
                  <option value="0">普通</option>
                  <option value="1">农场B</option>
                </select>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-row">
        <div class="layui-col-md5">
          <div class="layui-form-item">
            <label class="layui-form-label"><i class="txt">*</i>种植类型</label>
            <div class="layui-input-block">
              <select name="city2" lay-verify="required">
                <option value="0">作物A</option>
                <option value="1">农场B</option>
              </select>
            </div>
          </div>
        </div>
        <div class="layui-col-md5">
          <div class="layui-form-item">
            <label class="layui-form-label"><i class="txt">*</i>种植面积</label>
            <div class="layui-input-inline">
              <input name="password" required lay-verify="required" placeholder="请输入地块面积" autocomplete="off"
                     class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">亩</div>
          </div>
        </div>
      </div>
      <div class="layui-row">
        <div class="layui-row">
          <div class="layui-col-md5">
            <div class="layui-form-item">
              <label class="layui-form-label"><i class="txt">*</i>所属管理区</label>
              <div class="layui-input-block">
                <select name="city3" lay-verify="required">
                  <option value="0">大棚</option>
                  <option value="1">农场B</option>
                </select>
              </div>
            </div>
          </div>
          <div class="layui-col-md5">
            <div class="layui-form-item">
              <label class="layui-form-label"><i class="txt">*</i>采集方式</label>
              <div class="layui-input-block">
                <select name="city4" lay-verify="required">
                  <option value="0">普通</option>
                  <option value="1">农场B</option>
                </select>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <div class="layui-col-md10">
        <label class="layui-form-label">地块介绍</label>
        <div class="layui-input-block">
          <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
        </div>
      </div>
      <div class="layui-form-item">
        <button type="button" class="layui-btn btn" id="test1">
          <i class="layui-icon">&#xe67c;</i>多图片上传
        </button>
      </div>
      <div class="layui-row">
        <div class="layui-col-md4">
          <span>&nbsp;</span>
        </div>
        <div class="layui-col-md4">
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
              <button type="reset" class="layui-btn layui-btn-primary">取消</button>
            </div>
          </div>
        </div>
        <div class="layui-col-md4">
          <span>&nbsp;</span>
        </div>
      </div>
    </form>
  </div>
</body>

</html>
<script>
  layui.use('form', function () {
    var form = layui.form;
    //监听提交
    form.on('submit(formDemo)', function (data) { //提交事件回调
      layer.msg(JSON.stringify(data.field));
      return false;
    });
  });
  layui.use('upload', function () {
    var upload = layui.upload;
    //执行实例
    var uploadInst = upload.render({
      elem: '#test1' //绑定元素
        ,
      url: '/upload/' //上传接口
        ,
      multiple: true, // 是否支持多图片上传
      done: function (res) {
        //上传完毕回调
      },
      error: function () {
        //请求异常回调
      }
    });
  });
</script>